#ifndef CompareNames_h__
#define CompareNames_h__

#include <QString>

// english name comparing and formatting
class EnglishName
{
	typedef enum {SAME, SIMILAR, NOTSAME} CompareResult;

public:
	EnglishName(const QString& fullName);
    QString toString(const QString& formatString) const;
    QString getFirstName()  const { return first;  }
    QString getLastName()   const { return last;   }
    QString getMiddleName() const { return middle; }

	static bool compare(const QString& lhs, const QString& rhs);

private:
	QString takeLastName (QString& fullName);
	QString takeFirstName(QString& fullName);
	static CompareResult compareSections(const QString& lhs, const QString& rhs);
	QString toInitial(const QString& name) const;
    QString formatSection(const QString& format) const;

private:
	QString first;
	QString middle;
	QString last;
};



#endif // CompareNames_h__
